// components/song-list-group/index.js
import { playerStore } from '../../store/index'
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    songList: {
      type: Array,
      value: [] 
    },
    indexShow: {
      type: Boolean,
      value: true
    },
    showHeader: {
      type: Boolean,
      value: true
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleClickSongListItem(e) {
      const id = e.target.dataset.id
      const index = e.target.dataset.index
      console.log(id, index)
      playerStore.setState("songIndex", index)
      playerStore.setState("songList", this.properties.songList)
      wx.navigateTo({
        url: '/pages/song-player/index?id=' + id,
      })
    }
  }
})
